// -----------------------------------------------
// Design : Muhamad Aris
// URL    : https://www.facebook.com/aris.zoldyck
// -----------------------------------------------
//<![CDATA[
function removeHtmlTag(strx,chop){
if(strx.indexOf("<")!=-1)
{
var s = strx.split("<");
for(var i=0;i<s.length;i++){
if(s[i].indexOf(">")!=-1){
s[i] = s[i].substring(s[i].indexOf(">")+1,s[i].length);
}
}
strx = s.join("");
}
chop = (chop < strx.length-1) ? chop : strx.length-2;
while(strx.charAt(chop-1)!=' ' && strx.indexOf(' ',chop)!=-1) chop++;
strx = strx.substring(0,chop-1);
return strx+'...';
}
function createSummaryAndThumb(pID){
var div = document.getElementById(pID);
var imgtag = "";
var img = div.getElementsByTagName("img");
var summ = summary_noimg;
if(img.length>=1) {
imgtag = '<div class="crop"><img src="'+img[0].src+'" max-width="400px;" max-height="300px;" /></div>';
summ = summary_img;
}
  else{
imgtag = '<div class="crop"><img src="http://3.bp.blogspot.com/-uDFqJvuL5vU/Uy715IGaIxI/AAAAAAAAAGU/yWM0zAxZn4s/s1600/noimg.gif"/></div>';
summ = summary_noimg;
}
var summary = imgtag + '<div class="posting">' + removeHtmlTag(div.innerHTML,summ) + '</div>';
div.innerHTML = summary;
}
//]]>